package commons.utils.facades;

import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.browser.ProgressListener;
import org.eclipse.swt.browser.StatusTextListener;

import commons.utils.facades.BrowserFacade;
import commons.utils.facades.internal.FacadeFactory;

public abstract class BrowserFacade {

    private static final BrowserFacade _INSTANCE = FacadeFactory.createFacade(BrowserFacade.class);

    public static BrowserFacade getDefault() {
        return _INSTANCE;
    }

    public abstract void addProgressListener(Browser browser, ProgressListener listener);

    public abstract void addStatusTextListener(Browser browser, StatusTextListener listener);

    /**
     * Returns false when RAP
     * TODO add RAP implementation when method is supported
     * @param browser
     * @return
     */
    public abstract boolean isBackEnabled(Browser browser);

    /**
     * Returns false when RAP
     * TODO add RAP implementation when method is supported
     * @param browser
     * @return
     */
    public abstract boolean isForwardEnabled(Browser browser);

    /**
     * Do nothing when RAP
     * TODO add RAP implementation when method is supported
     * @param browser
     */
    public abstract void stop(Browser browser);

    /**
     * Do nothing when RAP. 
     * TODO add RAP implementation when method is supported
     * @param browser
     */
    public abstract void refresh(Browser browser);

    /**
     * Do nothing when RAP. 
     * TODO add RAP implementation when method is supported
     * @param browser
     */
    public abstract void forward(Browser browser);

    /**
     * Do nothing when RAP. 
     * TODO add RAP implementation when method is supported
     * @param browser
     */
    public abstract void back(Browser browser);

}
